package com.xiaoxie.common.enums;

/**
 * @author xiaoxie
 * @create 2025-01-19
 * @Version 1.0。0
 * @Description: 返回码枚举类
 */
public enum ReturnCode {
    SUCCESS(200, "成功"),
    FAIL(400, "失败"),

    CRON_EXPRESSION_ERROR(600, "cron表达式无效"),
    JOB_EXISTS(601, "任务已存在"),
    JOB_CLASS_NOT_EXIST(602, "任务类不存在" ),
    JOB_NAME_OR_JOB_GROUP_EMPTY(603, "任务名和任务分组都不可以为空"),

    DATASOURCE_NOT_EXIST(700, "数据源不存在"),

    UNAUTHORIZED(901, "未登录"),
    FORBIDDEN(902, "禁止访问"),
    NOT_PERMISSION(903, "没有权限"),
    ;

    private Integer code;
    private String message;

    ReturnCode(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
